exports.getImageInfo = function(req,res){

    var restfulParams = req.routeInfo.restfulParams;

    var resultData = {};
    var imageCategory = [];

    //获取图库类型列表
    function cmsImageCategorySearch(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsImageCategorySearch.Request_Api_Url + "/cic_is_delete/0",
                method : 'GET'
            },
            function (data) { 

                if(data.result.data.length < 1){
                    return RES.errorResponse(res,'抱歉，没有图库分类，请先添加分类后尝试。');
                }
                
                imageCategory  = data.result.data;

                cb();
                
            }
        )
    }

    //获取图库列表
    function cmsImageLibrarySearch(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsImageLibrarySearch.Request_Api_Url + "/cil_is_delete/0",
                method : 'GET'
            },
            function (data) { 

                var newArr = [];
                for(var cc=0;cc<imageCategory.length;cc++){
                	imageCategory[cc].arr = [];
                	for(var ss=0;ss<data.result.data.length;ss++){
                		if(imageCategory[cc].cic_id == data.result.data[ss].cil_cicid){
                			imageCategory[cc].arr.push(data.result.data[ss])
                		}
                	}
                }

                resultData = imageCategory;

                cb();
                
            }
        )
    }

    F.Serial([
        cmsImageCategorySearch,
        cmsImageLibrarySearch
    ],() => {
        RES.successResponse(res,resultData);
    })

}